package pers.wensheng.patterns.behavioral_pattern.chain_responsibility_pattern;

import pers.wensheng.patterns.behavioral_pattern.chain_responsibility_pattern.entity.GeneralManager;
import pers.wensheng.patterns.behavioral_pattern.chain_responsibility_pattern.entity.GroupLeader;
import pers.wensheng.patterns.behavioral_pattern.chain_responsibility_pattern.entity.Manager;

/**
 * 责任链模式
 * 客户端测试
 */
public class Client {
    public static void main(String[] args) {
        //创面一个请假条对象
        LeaveRequest leave1 = new LeaveRequest("小明",2,"头疼");

        //创建各级领导对象
        GroupLeader groupLeader = new GroupLeader();
        Manager manager = new Manager();
        GeneralManager generalManager = new GeneralManager();

        //设置处理者链
        groupLeader.setNetxHandler(manager);
        manager.setNetxHandler(generalManager);

        //提交请假申请
        groupLeader.submit(leave1);


    }
}
